﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using RBAC.api.Application.commond.Provincescitiesandcounties;
using RBAC.api.Application.commond.Slaughter;
using RBAC.Common.Domains.RabbitProject;
using RBAC.Common.Dto;
using RBAC.Common.Dto.ProSorce;
using RBAC.Enum;

namespace RBAC.api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SlaughterCreateController1 : ControllerBase
    {

        private readonly IMediator _mediator;

        public SlaughterCreateController1(IMediator mediator)
        {
            _mediator = mediator;
        }

        /// <summary>
        /// 屠宰企业信息添加
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// 
        [HttpPost]
        public async Task<Rulst> SlaughterCreateAdd(SlaughterCreateCommond request, CancellationToken cancellationToken)
        {

            var query = await _mediator.Send(request);
            return query;



        }

        /// <summary>
        /// 企业信息添加
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Rulst> SlaughteringenterprisCreate(SlaughteringenterpriseCommond request, CancellationToken cancellationToken)
        {
            var query = await _mediator.Send(request);



            return query;



        }

        /// <summary>
        /// 相关资质添加
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Rulst> SlaughterCreateImagesAdd(SlaughterCreateImagesCommond request, CancellationToken cancellationToken)
        {
            var query = await _mediator.Send(request);


            return query;




        }






        /// <summary>
        /// 屠宰企业照片添加
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Rulst> RelevantqualifiedenterpriseAdd(RelevantqualifiedenterprisesCommond request, CancellationToken cancellationToken)
        {
            var query = await _mediator.Send(request);
            return query;
        }



        /// <summary>
        /// 屠宰信息显示页面
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Rulst> SlaughterinformationdisplayHtml(SlaughterinformationdisplayHtmlCommond request, CancellationToken cancellationToken)
        {
            var query = await _mediator.Send(request);
            return query;
        }


        /// <summary>
        /// 省级下拉框
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Rulst> provinc(provinceCommond request, CancellationToken cancellationToken)
        {
            var list = await _mediator.Send(request);
            return list;
        }

        /// <summary>
        /// 市级
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>

        [HttpPost]
        public async Task<Rulst> City(CityCommmond request, CancellationToken cancellationToken)
        {
            var list = await _mediator.Send(request);

            return list;
        }
        /// <summary>
        /// 县级
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Rulst> county(countyCommond request, CancellationToken cancellationToken)
        {
            var list = await _mediator.Send(request);


            return list;

        }

    }
    }
